package com.itheima.mall.dubbo.api.oms;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.itheima.mall.dubbo.mapper.oms.OrderSettingMapper;
import com.itheima.mall.entity.domain.oms.Order;
import com.itheima.mall.entity.domain.oms.OrderSetting;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 订单设置表 服务实现类
 * </p>
 *
 * @author qinglang
 * @since 2022-07-05
 */
@Service
@DubboService
public class OrderSettingImplService extends ServiceImpl<OrderSettingMapper, OrderSetting> implements OrderSettingService {

    @Override
    public void updateSetting(Integer id, OrderSetting setting) {
        UpdateWrapper<OrderSetting> qw = new UpdateWrapper<>();
        qw.in("id", id);
        qw.set("flashOrderOvertime", setting.getFlashOrderOvertime());
        qw.set("normalOrderOvertime", setting.getNormalOrderOvertime());
        qw.set("confirmOvertime", setting.getConfirmOvertime());
        qw.set("finishOvertime", setting.getFinishOvertime());
        qw.set("commentOvertime", setting.getCommentOvertime());
        this.update(qw);
    }
}
